package com.info.zhiduoduo.pay.controller;

import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import com.info.zhiduoduo.pay.formbean.offlinepayment.CreateOrderFormBean;
import com.info.zhiduoduo.pay.formbean.offlinepayment.QueryOrderFormBean;
import com.info.zhiduoduo.pay.sdk.kltongpaysdk.model.offlinepayment.OfflinePaymentNotifyResult;
import com.info.zhiduoduo.pay.service.OfflinePaymentService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/offlinePayment")
public class OfflinePaymentController {

	@Autowired
	OfflinePaymentService offlinePaymentService;

	@PostMapping("/createOrder")
	public SmartResult createOrder(@RequestBody BaseSimpleFormBean<CreateOrderFormBean> formBean) {
		return offlinePaymentService.createOrder(formBean);
	}

	@PostMapping("/queryOrder")
	public SmartResult queryOrder(@RequestBody BaseSimpleFormBean<QueryOrderFormBean> formBean) {
		return offlinePaymentService.queryOrder(formBean);
	}
//
//	@PostMapping("/notify")
//	public String notify(OfflinePaymentNotifyResult notifyResult) {
//		return offlinePaymentService.paymentNotify(notifyResult);
//	}
}
